<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <c:forEach var="id_turma" items="${paramValues['id_turma']}">
            <c:catch var ="catchException">
                <sql:update var="update" dataSource="jdbc/dbo_MicrosoftSQLServer">
                    exec sp_reprocessar_turma ?
                    <sql:param value="${id_turma}"/>
                </sql:update>               
                <p>Turma ${id_turma} processada</p>
            </c:catch>
            <c:if test = "${catchException!=null}">
                <br>
                Erro : Erro ao processar turma ${id_turma}.<br>
                <p  style="color:red">${fn:substringAfter(catchException,"BD:")}</p>
                ${catchException}
            </c:if>
        </c:forEach>


    </body>
</html>
